package com.atguigu.eduservice.controller;


import com.atguigu.commonutils.R;
import com.atguigu.eduservice.entity.vo.CourserInfoVo;
import com.atguigu.eduservice.service.EduCourseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 课程 前端控制器
 * </p>
 *
 * @author hjt
 * @since 2021-07-02
 */
@RestController
@RequestMapping("/eduService/course")
@CrossOrigin
public class EduCourseController {

    @Autowired
    EduCourseService courseService;

    /**
     * 添加课程信息
     *
     * @return
     */
    @PostMapping("addCourse")
    public R addCourseInfo(@RequestBody CourserInfoVo courserInfoVo) {
        String id = courseService.addCourseInfo(courserInfoVo);
        return R.ok().data("courseId",id);
    }
}

